#include <iostream>
using namespace std;

//模版方法
class ApplictionFramework
{
protected:
    virtual void func1() = 0;
    virtual void func2() = 0;

public:
    void templateMethod()
    {
        for (int i = 0; i < 5; i++)
        {
            func1();
            func2();
        }
    }
};

class Applictaion : public ApplictionFramework
{
    void func1()
    {
        cout << "hello ";
    };
    void func2()
    {
        cout << "world" << endl;
    };
};

int main()
{
    Applictaion app;
    app.templateMethod();
    return 0;
}